<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"><title>springboot-静态页面无法加载 | buqiugouda的博客主页</title><meta name="author" content="不求勾搭"><meta name="copyright" content="不求勾搭"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="现象前段时间帮项目上的同事改造一个springboot项目，后端使用springboot框架开发，前端使用node.js编译后将静态资源放到后端自行新增的webapp目录下,  又套用了web.xml等一系列配置将项目改造成了web项目,最终以war包形式进行发布。">
<meta property="og:type" content="article">
<meta property="og:title" content="springboot-静态页面无法加载">
<meta property="og:url" content="http://buqiugouda.gitee.io/%E5%B7%A5%E4%BD%9C%E5%A4%8D%E7%9B%98/springboot-%E9%9D%99%E6%80%81%E9%A1%B5%E9%9D%A2%E6%97%A0%E6%B3%95%E5%8A%A0%E8%BD%BD/index.html">
<meta property="og:site_name" content="buqiugouda的博客主页">
<meta property="og:description" content="现象前段时间帮项目上的同事改造一个springboot项目，后端使用springboot框架开发，前端使用node.js编译后将静态资源放到后端自行新增的webapp目录下,  又套用了web.xml等一系列配置将项目改造成了web项目,最终以war包形式进行发布。">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="http://buqiugouda.gitee.io/img/covers/note.png">
<meta property="article:published_time" content="2019-07-01T02:31:35.000Z">
<meta property="article:modified_time" content="2023-08-21T08:16:08.852Z">
<meta property="article:author" content="不求勾搭">
<meta property="article:tag" content="SpringBoot">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="http://buqiugouda.gitee.io/img/covers/note.png"><link rel="shortcut icon" href="/myblog/img/favicon.ico"><link rel="canonical" href="http://buqiugouda.gitee.io/%E5%B7%A5%E4%BD%9C%E5%A4%8D%E7%9B%98/springboot-%E9%9D%99%E6%80%81%E9%A1%B5%E9%9D%A2%E6%97%A0%E6%B3%95%E5%8A%A0%E8%BD%BD/index.html"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="stylesheet" href="/myblog/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.min.css" media="print" onload="this.media='all'"><script>const GLOBAL_CONFIG = { 
  root: '/myblog/',
  algolia: undefined,
  localSearch: undefined,
  translate: undefined,
  noticeOutdate: undefined,
  highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":false},
  copy: {
    success: '复制成功',
    error: '复制错误',
    noSupport: '浏览器不支持'
  },
  relativeDate: {
    homepage: false,
    post: false
  },
  runtime: '',
  date_suffix: {
    just: '刚刚',
    min: '分钟前',
    hour: '小时前',
    day: '天前',
    month: '个月前'
  },
  copyright: undefined,
  lightbox: 'fancybox',
  Snackbar: undefined,
  source: {
    justifiedGallery: {
      js: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery/dist/fjGallery.min.js',
      css: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery/dist/fjGallery.min.css'
    }
  },
  isPhotoFigcaption: false,
  islazyload: false,
  isAnchor: false,
  percent: {
    toc: true,
    rightside: false,
  }
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
  title: 'springboot-静态页面无法加载',
  isPost: true,
  isHome: false,
  isHighlightShrink: false,
  isToc: true,
  postUpdate: '2023-08-21 16:16:08'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><script>(win=>{
    win.saveToLocal = {
      set: function setWithExpiry(key, value, ttl) {
        if (ttl === 0) return
        const now = new Date()
        const expiryDay = ttl * 86400000
        const item = {
          value: value,
          expiry: now.getTime() + expiryDay,
        }
        localStorage.setItem(key, JSON.stringify(item))
      },

      get: function getWithExpiry(key) {
        const itemStr = localStorage.getItem(key)

        if (!itemStr) {
          return undefined
        }
        const item = JSON.parse(itemStr)
        const now = new Date()

        if (now.getTime() > item.expiry) {
          localStorage.removeItem(key)
          return undefined
        }
        return item.value
      }
    }
  
    win.getScript = url => new Promise((resolve, reject) => {
      const script = document.createElement('script')
      script.src = url
      script.async = true
      script.onerror = reject
      script.onload = script.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        script.onload = script.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(script)
    })
  
    win.getCSS = url => new Promise((resolve, reject) => {
      const link = document.createElement('link')
      link.rel = 'stylesheet'
      link.href = url
      link.onload = () => resolve()
      link.onerror = () => reject()
      document.head.appendChild(link)
    })
  
      win.activateDarkMode = function () {
        document.documentElement.setAttribute('data-theme', 'dark')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
        }
      }
      win.activateLightMode = function () {
        document.documentElement.setAttribute('data-theme', 'light')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
        }
      }
      const t = saveToLocal.get('theme')
    
          if (t === 'dark') activateDarkMode()
          else if (t === 'light') activateLightMode()
        
      const asideStatus = saveToLocal.get('aside-status')
      if (asideStatus !== undefined) {
        if (asideStatus === 'hide') {
          document.documentElement.classList.add('hide-aside')
        } else {
          document.documentElement.classList.remove('hide-aside')
        }
      }
    
    const detectApple = () => {
      if(/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
        document.documentElement.classList.add('apple')
      }
    }
    detectApple()
    })(window)</script><meta name="generator" content="Hexo 5.4.2"></head><body><div id="web_bg"></div><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src="https://foruda.gitee.com/avatar/1676921533047997408/590832_buqiugouda_1620800091.png" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="sidebar-site-data site-data is-center"><a href="/myblog/archives/"><div class="headline">文章</div><div class="length-num">11</div></a><a href="/myblog/tags/"><div class="headline">标签</div><div class="length-num">9</div></a><a href="/myblog/categories/"><div class="headline">分类</div><div class="length-num">9</div></a></div><hr/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/myblog/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/myblog/archives/"><i class="fa-fw fas fa-archive"></i><span> 时间轴</span></a></div><div class="menus_item"><a class="site-page" href="/myblog/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/myblog/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page" href="/myblog/about/"><i class="fa-fw fas fa-heart"></i><span> 关于我</span></a></div></div></div></div><div class="post" id="body-wrap"><header class="post-bg" id="page-header" style="background-image: url('/myblog/img/covers/note.png')"><nav id="nav"><span id="blog-info"><a href="/myblog/" title="buqiugouda的博客主页"><span class="site-name">buqiugouda的博客主页</span></a></span><div id="menus"><div class="menus_items"><div class="menus_item"><a class="site-page" href="/myblog/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/myblog/archives/"><i class="fa-fw fas fa-archive"></i><span> 时间轴</span></a></div><div class="menus_item"><a class="site-page" href="/myblog/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/myblog/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page" href="/myblog/about/"><i class="fa-fw fas fa-heart"></i><span> 关于我</span></a></div></div><div id="toggle-menu"><a class="site-page" href="javascript:void(0);"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="post-info"><h1 class="post-title">springboot-静态页面无法加载</h1><div id="post-meta"><div class="meta-firstline"><span class="post-meta-date"><i class="fa-fw post-meta-icon far fa-calendar-alt"></i><span class="post-meta-label">发表于</span><time datetime="2019-07-01T02:31:35.000Z" title="发表于 2019-07-01 10:31:35">2019-07-01</time></span><span class="post-meta-categories"><span class="post-meta-separator">|</span><i class="fas fa-inbox fa-fw post-meta-icon"></i><a class="post-meta-categories" href="/myblog/categories/%E5%B7%A5%E4%BD%9C%E5%A4%8D%E7%9B%98/">工作复盘</a></span></div><div class="meta-secondline"></div></div></div></header><main class="layout" id="content-inner"><div id="post"><article class="post-content" id="article-container"><h2 id="现象"><a href="#现象" class="headerlink" title="现象"></a>现象</h2><p>前段时间帮项目上的同事改造一个springboot项目，后端使用springboot框架开发，前端使用node.js编译后将静态资源放到后端自行新增的webapp目录下,  又套用了web.xml等一系列配置将项目改造成了web项目,最终以war包形式进行发布。  </p>
<span id="more"></span>

<p>本人的任务是为此项目接入统一认证的平台，使用了已经验证过的拦截器，来实现登录的会话验证。强迫症让我又将项目结构调整为普通的springboot的结构。</p>
<p>在添加完拦截器之后，后端接口测试基本都一次过,拦截器的逻辑也都符合预期。但是加入静态资源后，进入主页却始终无法引用到相关的静态资源。</p>
<p><img src="/myblog/%E5%B7%A5%E4%BD%9C%E5%A4%8D%E7%9B%98/springboot-%E9%9D%99%E6%80%81%E9%A1%B5%E9%9D%A2%E6%97%A0%E6%B3%95%E5%8A%A0%E8%BD%BD/%E5%BC%82%E5%B8%B8%E4%B8%BB%E9%A1%B50.png"></p>
<p>而所有单独请求静态资源的url都返回404，查看idea 发现以下日志记录<br><img src="/myblog/%E5%B7%A5%E4%BD%9C%E5%A4%8D%E7%9B%98/springboot-%E9%9D%99%E6%80%81%E9%A1%B5%E9%9D%A2%E6%97%A0%E6%B3%95%E5%8A%A0%E8%BD%BD/%E9%9D%99%E6%80%81%E8%B5%84%E6%BA%90%E6%9C%AA%E8%AF%86%E5%88%AB7a3a0a8a.png"></p>
<h3 id="项目结构"><a href="#项目结构" class="headerlink" title="项目结构"></a>项目结构</h3><p> 静态文件结构:<br><img src="/myblog/%E5%B7%A5%E4%BD%9C%E5%A4%8D%E7%9B%98/springboot-%E9%9D%99%E6%80%81%E9%A1%B5%E9%9D%A2%E6%97%A0%E6%B3%95%E5%8A%A0%E8%BD%BD/%E9%A1%B9%E7%9B%AE%E7%BB%93%E6%9E%84f978d5f6.png"></p>
<p>前端页面的解析使用sprinboot提供的thymeleaf,并在配置文件中完成配置。<br><img src="/myblog/%E5%B7%A5%E4%BD%9C%E5%A4%8D%E7%9B%98/springboot-%E9%9D%99%E6%80%81%E9%A1%B5%E9%9D%A2%E6%97%A0%E6%B3%95%E5%8A%A0%E8%BD%BD/thymeleaf%E9%A1%B5%E9%9D%A2%E8%A7%A3%E6%9E%901e5a6d02.png"></p>
<h2 id="解决问题的流程"><a href="#解决问题的流程" class="headerlink" title="解决问题的流程"></a>解决问题的流程</h2><h3 id="排查资源编译路径"><a href="#排查资源编译路径" class="headerlink" title="排查资源编译路径"></a>排查资源编译路径</h3><p>最初只是注意到页面的空白，以及idea的日志记录，百度后就认定为静态资源无法读取。<br>重新maven编译后，确认target的同目录结构下，是存在相关静态资源的，于是排除了编译问题。</p>
<h3 id="排查springboot关于静态文件的读取配置"><a href="#排查springboot关于静态文件的读取配置" class="headerlink" title="排查springboot关于静态文件的读取配置"></a>排查springboot关于静态文件的读取配置</h3><p>由于接触的项目跨度比较大，从jsp之后，经手的项目都是前后端分离的。所以去网络上查找也学习了关于静态文件的配置方法。</p>
<p>参考此文档后 <a target="_blank" rel="noopener" href="https://www.jianshu.com/p/a9e6edd46e98">https://www.jianshu.com/p/a9e6edd46e98</a> ,算是理清了静态文件资源的读取规则。<br>于是满怀信心后添加配置<br><img src="/myblog/%E5%B7%A5%E4%BD%9C%E5%A4%8D%E7%9B%98/springboot-%E9%9D%99%E6%80%81%E9%A1%B5%E9%9D%A2%E6%97%A0%E6%B3%95%E5%8A%A0%E8%BD%BD/springboot%E9%9D%99%E6%80%81%E6%96%87%E4%BB%B6%E9%85%8D%E7%BD%AEa206d7fd.png"></p>
<p>但页面依旧没有任何变化。冷静查看 spring.resources.static-locations 指向的默认配置类<br><img src="/myblog/%E5%B7%A5%E4%BD%9C%E5%A4%8D%E7%9B%98/springboot-%E9%9D%99%E6%80%81%E9%A1%B5%E9%9D%A2%E6%97%A0%E6%B3%95%E5%8A%A0%E8%BD%BD/%E9%9D%99%E6%80%81%E6%96%87%E4%BB%B6%E9%BB%98%E8%AE%A4%E9%85%8D%E7%BD%AE7a27e960.png"><br>而我的项目中，存放静态资源的位置，本来就位于其中,加上sprongboot默认的静态资源匹配规则就是 /**, 其实我这个项目压根就用不着额外配置</p>
<p>继续翻阅文章是，注意到springboot早起的版本，对于静态资源的放行，不是直接配置而是放到了拦截器中进行处理。正好我做会话认证的功能也是写在自定义拦截器的实现类中,于是仿写了相关配置在拦截器中进行静态资源的匹配和处理规则。<br><img src="/myblog/%E5%B7%A5%E4%BD%9C%E5%A4%8D%E7%9B%98/springboot-%E9%9D%99%E6%80%81%E9%A1%B5%E9%9D%A2%E6%97%A0%E6%B3%95%E5%8A%A0%E8%BD%BD/%E8%87%AA%E5%AE%9A%E4%B9%89%E6%8B%A6%E6%88%AA%E5%99%A8%E5%AE%9E%E7%8E%B0%E7%B1%BBe33b5431.png"></p>
<p>再次打开项目，进入主页时，异常居然就解决了。<br><img src="/myblog/%E5%B7%A5%E4%BD%9C%E5%A4%8D%E7%9B%98/springboot-%E9%9D%99%E6%80%81%E9%A1%B5%E9%9D%A2%E6%97%A0%E6%B3%95%E5%8A%A0%E8%BD%BD/%E6%AD%A3%E5%B8%B8%E7%9A%84%E4%B8%BB%E9%A1%B5dbf500e7.png"></p>
<h2 id="解决方案"><a href="#解决方案" class="headerlink" title="解决方案"></a>解决方案</h2><p>再次审阅我的自定义”拦截器”<br><img src="/myblog/%E5%B7%A5%E4%BD%9C%E5%A4%8D%E7%9B%98/springboot-%E9%9D%99%E6%80%81%E9%A1%B5%E9%9D%A2%E6%97%A0%E6%B3%95%E5%8A%A0%E8%BD%BD/%E5%94%AF%E4%B8%80%E9%85%8D%E7%BD%AE%E7%B1%BB3f5855e9.png"></p>
<p>等等为什么这个类 是在继承 WebMvcConfigurationSupport, 我的其他项目中使用拦截器似乎有点不同。<br><img src="/myblog/%E5%B7%A5%E4%BD%9C%E5%A4%8D%E7%9B%98/springboot-%E9%9D%99%E6%80%81%E9%A1%B5%E9%9D%A2%E6%97%A0%E6%B3%95%E5%8A%A0%E8%BD%BD/%E5%85%B6%E4%BB%96%E9%A1%B9%E7%9B%AE%E7%9A%84%E6%8B%A6%E6%88%AA%E5%99%A8567273b7.png"><br>其他项目中使用的都是 WebMvcConfigurer的自定义实现类</p>
<p>继续搜索了相关资料后, 了解了WebMvcConfigurationSupport 和 WebMvcConfigurer 的区别和关联<br>参考链接: <a target="_blank" rel="noopener" href="https://www.jianshu.com/p/c5c1503f5367">https://www.jianshu.com/p/c5c1503f5367</a></p>
<p>WebMvcConfigurationSupport 在整个应用程序中只会生效一个，如果用户已经实现了 WebMvcConfigurationSupport，则 DelegatingWebMvcConfiguration 将不会生效。换句话来说，WebMvcConfigurer 的所有实现类将不会生效。<br>而在Spring 中，如果类路径上不存在 WebMvcConfigurationSupport 的实例，则将会默认实现WebMvcConfigurerAdapter、DelegatingWebMvcConfiguration 来自定义mvc 配置。</p>
<h2 id="最终方案"><a href="#最终方案" class="headerlink" title="最终方案"></a>最终方案</h2><p>对于我本次改造的项目而言,静态文件的存放路径就在springboot的默认配置路径中,不要额外指定和配置。只需要修改拦截器的实现类，使用 WebMvcConfigurer 的自定义实现类来定义会话拦截器就可以了。</p>
<h2 id="反思"><a href="#反思" class="headerlink" title="反思"></a>反思</h2></article><div class="post-copyright"><div class="post-copyright__author"><span class="post-copyright-meta">文章作者: </span><span class="post-copyright-info"><a href="http://buqiugouda.gitee.io">不求勾搭</a></span></div><div class="post-copyright__type"><span class="post-copyright-meta">文章链接: </span><span class="post-copyright-info"><a href="http://buqiugouda.gitee.io/%E5%B7%A5%E4%BD%9C%E5%A4%8D%E7%9B%98/springboot-%E9%9D%99%E6%80%81%E9%A1%B5%E9%9D%A2%E6%97%A0%E6%B3%95%E5%8A%A0%E8%BD%BD/">http://buqiugouda.gitee.io/%E5%B7%A5%E4%BD%9C%E5%A4%8D%E7%9B%98/springboot-%E9%9D%99%E6%80%81%E9%A1%B5%E9%9D%A2%E6%97%A0%E6%B3%95%E5%8A%A0%E8%BD%BD/</a></span></div><div class="post-copyright__notice"><span class="post-copyright-meta">版权声明: </span><span class="post-copyright-info">本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank">CC BY-NC-SA 4.0</a> 许可协议。转载请注明来自 <a href="http://buqiugouda.gitee.io" target="_blank">buqiugouda的博客主页</a>！</span></div></div><div class="tag_share"><div class="post-meta__tag-list"><a class="post-meta__tags" href="/myblog/tags/SpringBoot/">SpringBoot</a></div><div class="post_share"><div class="social-share" data-image="/myblog/img/covers/note.png" data-sites="facebook,twitter,wechat,weibo,qq"></div><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/butterfly-extsrc/sharejs/dist/css/share.min.css" media="print" onload="this.media='all'"><script src="https://cdn.jsdelivr.net/npm/butterfly-extsrc/sharejs/dist/js/social-share.min.js" defer></script></div></div><nav class="pagination-post" id="pagination"><div class="prev-post pull-left"><a href="/myblog/%E5%B7%A5%E4%BD%9C%E5%A4%8D%E7%9B%98/%E5%8C%BA%E5%9F%9F%E6%88%AA%E5%9B%BE%E5%BC%82%E5%B8%B8%E9%97%AE%E9%A2%98%E6%8E%92%E6%9F%A5/" title="区域截图异常问题排查"><img class="cover" src="/myblog/img/covers/note.png" onerror="onerror=null;src='/myblog/img/404.jpg'" alt="cover of previous post"><div class="pagination-info"><div class="label">上一篇</div><div class="prev_info">区域截图异常问题排查</div></div></a></div><div class="next-post pull-right"><a href="/myblog/hexo%E9%85%8D%E7%BD%AE%E4%B8%8E%E4%BD%BF%E7%94%A8/hexo%E4%BD%BF%E7%94%A8butterfly%E4%B8%BB%E9%A2%98/" title="hexo 使用主题butterfly"><img class="cover" src="https://fastly.jsdelivr.net/gh/jerryc127/butterfly_cdn@2.1.0/top_img/index.jpg" onerror="onerror=null;src='/myblog/img/404.jpg'" alt="cover of next post"><div class="pagination-info"><div class="label">下一篇</div><div class="next_info">hexo 使用主题butterfly</div></div></a></div></nav></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="is-center"><div class="avatar-img"><img src="https://foruda.gitee.com/avatar/1676921533047997408/590832_buqiugouda_1620800091.png" onerror="this.onerror=null;this.src='/myblog/img/friend_404.gif'" alt="avatar"/></div><div class="author-info__name">不求勾搭</div><div class="author-info__description">路漫漫其修远兮，吾将上下而求索！</div></div><div class="card-info-data site-data is-center"><a href="/myblog/archives/"><div class="headline">文章</div><div class="length-num">11</div></a><a href="/myblog/tags/"><div class="headline">标签</div><div class="length-num">9</div></a><a href="/myblog/categories/"><div class="headline">分类</div><div class="length-num">9</div></a></div><a id="card-info-btn" target="_blank" rel="noopener" href="https://gitee.com/buqiugouda"><i class="fab fa-github"></i><span>Follow Me</span></a></div><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn fa-shake"></i><span>公告</span></div><div class="announcement_content">嗨害嗨，来啦⚔️。<br>这里有我个人编写的随笔，也有收集的资料文章。<br>内容只用于个人学习、温故而知新。<br>如有侵权,可以联系我😊</div></div><div class="sticky_layout"><div class="card-widget" id="card-toc"><div class="item-headline"><i class="fas fa-stream"></i><span>目录</span><span class="toc-percentage"></span></div><div class="toc-content"><ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E7%8E%B0%E8%B1%A1"><span class="toc-number">1.</span> <span class="toc-text">现象</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E9%A1%B9%E7%9B%AE%E7%BB%93%E6%9E%84"><span class="toc-number">1.1.</span> <span class="toc-text">项目结构</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E8%A7%A3%E5%86%B3%E9%97%AE%E9%A2%98%E7%9A%84%E6%B5%81%E7%A8%8B"><span class="toc-number">2.</span> <span class="toc-text">解决问题的流程</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E6%8E%92%E6%9F%A5%E8%B5%84%E6%BA%90%E7%BC%96%E8%AF%91%E8%B7%AF%E5%BE%84"><span class="toc-number">2.1.</span> <span class="toc-text">排查资源编译路径</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E6%8E%92%E6%9F%A5springboot%E5%85%B3%E4%BA%8E%E9%9D%99%E6%80%81%E6%96%87%E4%BB%B6%E7%9A%84%E8%AF%BB%E5%8F%96%E9%85%8D%E7%BD%AE"><span class="toc-number">2.2.</span> <span class="toc-text">排查springboot关于静态文件的读取配置</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88"><span class="toc-number">3.</span> <span class="toc-text">解决方案</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E6%9C%80%E7%BB%88%E6%96%B9%E6%A1%88"><span class="toc-number">4.</span> <span class="toc-text">最终方案</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%8F%8D%E6%80%9D"><span class="toc-number">5.</span> <span class="toc-text">反思</span></a></li></ol></div></div><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/myblog/%E5%B7%A5%E4%BD%9C%E5%A4%8D%E7%9B%98/Navicat%E8%83%BD%E8%BF%9E%E6%8E%A5%E6%95%B0%E6%8D%AE%E5%BA%93%E4%BD%86IDEA%E5%92%8CDbeaver%E8%BF%9E%E4%B8%8D%E4%B8%8A/" title="Navicat能连接数据库但IDEA和Dbeaver连不上">Navicat能连接数据库但IDEA和Dbeaver连不上</a><time datetime="2023-08-23T07:45:23.000Z" title="发表于 2023-08-23 15:45:23">2023-08-23</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/myblog/%E5%B7%A5%E4%BD%9C%E5%A4%8D%E7%9B%98/%E5%AE%A1%E6%89%B9%E6%B5%81%E5%8A%9F%E8%83%BD%E6%89%A9%E5%B1%95%E5%BC%80%E5%8F%91%E5%B7%A5%E4%BD%9C%E5%9B%9E%E9%A1%BE/" title="审批流功能扩展开发工作回顾">审批流功能扩展开发工作回顾</a><time datetime="2023-03-29T12:31:18.000Z" title="发表于 2023-03-29 20:31:18">2023-03-29</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/myblog/%E8%AF%BB%E4%B9%A6%E7%AC%94%E8%AE%B0/Spring/Spring%E4%BA%8B%E5%8A%A1%E5%A4%B1%E6%95%88%E7%9A%84%E5%9C%BA%E6%99%AF/" title="Spirng事务失效的场景">Spirng事务失效的场景</a><time datetime="2020-05-14T16:00:00.000Z" title="发表于 2020-05-15 00:00:00">2020-05-15</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/myblog/%E8%AF%BB%E4%B9%A6%E7%AC%94%E8%AE%B0/Spring%20Cloud/SpringColud%E6%A0%B8%E5%BF%83%E7%BB%84%E4%BB%B6%E6%B5%85%E6%9E%90/" title="SpringColud核心组件浅析">SpringColud核心组件浅析</a><time datetime="2020-01-29T16:00:00.000Z" title="发表于 2020-01-30 00:00:00">2020-01-30</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/myblog/%E8%AF%BB%E4%B9%A6%E7%AC%94%E8%AE%B0/%E8%AE%BE%E8%AE%A1%E6%A8%A1%E5%BC%8F/%E8%AE%BE%E8%AE%A1%E6%A8%A1%E5%BC%8F%E6%80%BB%E7%BB%93/" title="设计模式总结">设计模式总结</a><time datetime="2019-11-09T16:00:00.000Z" title="发表于 2019-11-10 00:00:00">2019-11-10</time></div></div></div></div></div></div></main><footer id="footer" style="background-image: url('/myblog/img/covers/note.png')"><div id="footer-wrap"><div class="copyright">&copy;2019 - 2023 <i id="heartbeat" class="fa fas fa-heartbeat"></i> By 不求勾搭</div></div><link rel="stylesheet" href="https://fastly.jsdelivr.net/gh/HCLonely/images@master/others/heartbeat.min.css"></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="readmode" type="button" title="阅读模式"><i class="fas fa-book-open"></i></button><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button class="close" id="mobile-toc-button" type="button" title="目录"><i class="fas fa-list-ul"></i></button><button id="go-up" type="button" title="回到顶部"><span class="scroll-percent"></span><i class="fas fa-arrow-up"></i></button></div></div><div><script src="/myblog/js/utils.js"></script><script src="/myblog/js/main.js"></script><script src="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.umd.min.js"></script><div class="js-pjax"></div><script defer="defer" id="fluttering_ribbon" mobile="false" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc/dist/canvas-fluttering-ribbon.min.js"></script></div></body></html>